package cn.itcast.dmp.report

import cn.itcast.dmp.config.AppConfigHelper
import cn.itcast.dmp.process.ReportProcessor
import org.apache.spark.sql.{DataFrame, SparkSession}

object ReportAdsIspProcessor  extends ReportProcessor{
  override def targetTableName: String = {
    AppConfigHelper.REPORT_ADS_ISP_TABLE_NAME
  }

  override def targetTableKeys: Seq[String] = {
    Seq("report_date", "ispid", "ispname")
  }

  override def realProcessData(odsDF: DataFrame): DataFrame = {
    val spark: SparkSession = odsDF.sparkSession
    odsDF.createTempView("ipsTable")
    val dataFrame: DataFrame = spark.sql(ReportSQLConstant.reportAdsKpiWithSQL("ipsTable",Seq("ispid", "ispname")))
    dataFrame

  }
}
